<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/**
<span class='line'>  2</span> * @fileoverview The Before Effects UI helper module. This module adds methods
<span class='line'>  3</span> * that aid in working with After EFfects User Interfaces.
<span class='line'>  4</span> * @author Collin D. Brooks &lt;collin.brooks@gmail.com>
<span class='line'>  5</span> * @version 0.1.0 dev
<span class='line'>  6</span> */</span><span class="WHIT">
<span class='line'>  7</span> 
<span class='line'>  8</span> </span><span class="COMM">//See if BE is already defined</span><span class="WHIT">
<span class='line'>  9</span> </span><span class="NAME">BE</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">BE</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 10</span> 
<span class='line'> 11</span> </span><span class="COMM">/*****************************************************************************\
<span class='line'> 12</span> * >>> UI Helper
<span class='line'> 13</span> \*****************************************************************************/</span><span class="WHIT">
<span class='line'> 14</span> 
<span class='line'> 15</span> </span><span class="COMM">/**
<span class='line'> 16</span>  * Contains User Interface Helper methods that allow for easier creation
<span class='line'> 17</span>  * and debugging of UI.
<span class='line'> 18</span>  * @constructor
<span class='line'> 19</span>  * @extends BE
<span class='line'> 20</span>  * @see BE
<span class='line'> 21</span>  * @namespace
<span class='line'> 22</span>  */</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="NAME">BE.ui</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="WHIT">    </span><span class="NAME">version</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"0.1.0 dev"</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 26</span> 
<span class='line'> 27</span> </span><span class="COMM">/**
<span class='line'> 28</span>  *A list of error constants to be reported to the user when errors arise.
<span class='line'> 29</span>  *@constant
<span class='line'> 30</span>  */</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="NAME">BE.ui.error</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT">    </span><span class="NAME">NO_DATA_FOR_INPUT_GENERATOR</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"The data object is undefined!"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT">    </span><span class="NAME">NO_GROUP_NAME</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"You must specify the group name to generate an "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT">        </span><span class="STRN">"input field! Please set 'groupName'!"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT">    </span><span class="NAME">NO_LABEL_NAME</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"You must specify the label name to generate an "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT">        </span><span class="STRN">"input field! Please set 'labelName'!"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT">    </span><span class="NAME">NO_INPUT_NAME</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"You must specify the input name to generate an "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT">        </span><span class="STRN">"input field! Please set 'inputName'!"</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 40</span> 
<span class='line'> 41</span> </span><span class="COMM">/**
<span class='line'> 42</span>  * Takes an error that is returned when a ScriptUI resource specification
<span class='line'> 43</span>  * is malformed and makes it easier for you to figure out where the
<span class='line'> 44</span>  * error occures.
<span class='line'> 45</span>  * @param {Error} err The error that was returned when the resource string
<span class='line'> 46</span>  * was run.
<span class='line'> 47</span>  * @param {String} res The resource string that contains the error.
<span class='line'> 48</span>  * @return {String} The error text that is generated.
<span class='line'> 49</span>  */</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="NAME">BE.ui.resError</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">err</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">res</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 53</span> 	 *@type Regexp
<span class='line'> 54</span> 	 */</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rx</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT">		</span><span class="NAME">search</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT">		</span><span class="NAME">errorLine</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT">		</span><span class="NAME">errorCharOffset</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT">		</span><span class="NAME">lines</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT">		</span><span class="NAME">theLine</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT">		</span><span class="NAME">errText</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT">		</span><span class="NAME">surroundingLinesPadding</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT">		</span><span class="NAME">linesBefore</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT">		</span><span class="NAME">linesAfter</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="WHIT">		</span><span class="NAME">l</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 66</span> 
<span class='line'> 67</span> </span><span class="WHIT">	</span><span class="NAME">rx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="REGX">/Error in line (\d*)\, at character offset (\d*)\,/</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 68</span> 
<span class='line'> 69</span> </span><span class="WHIT">	</span><span class="COMM">//If this error is actually a resource error, handle it like one.</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">rx.test</span><span class="PUNC">(</span><span class="NAME">err.description</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT">		</span><span class="NAME">BE.log.debug</span><span class="PUNC">(</span><span class="STRN">"Resource Error occured..."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT">        </span><span class="NAME">BE.log.debug</span><span class="PUNC">(</span><span class="STRN">"Original error: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">err.description</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="WHIT">		</span><span class="NAME">search</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">rx.exec</span><span class="PUNC">(</span><span class="NAME">err.description</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="WHIT">		</span><span class="NAME">errorLine</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">search</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT">		</span><span class="NAME">errorCharOffset</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">search</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="WHIT">		</span><span class="NAME">lines</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">res.split</span><span class="PUNC">(</span><span class="STRN">"\n"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 77</span> </span><span class="WHIT">		</span><span class="NAME">theLine</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">lines</span><span class="PUNC">[</span><span class="NAME">errorLine</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 78</span> 
<span class='line'> 79</span> </span><span class="WHIT">		</span><span class="COMM">//Error printing options</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="WHIT">		</span><span class="NAME">surroundingLinesPadding</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 81</span> 
<span class='line'> 82</span> </span><span class="WHIT">		</span><span class="COMM">//Set the default lines before and after based upon</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="WHIT">		</span><span class="COMM">//the surroundingLinesPadding value</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="WHIT">		</span><span class="NAME">linesBefore</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">surroundingLinesPadding</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT">		</span><span class="NAME">linesAfter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">surroundingLinesPadding</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 86</span> 
<span class='line'> 87</span> 
<span class='line'> 88</span> </span><span class="WHIT">		</span><span class="NAME">BE.log.debug</span><span class="PUNC">(</span><span class="STRN">"Error Line # = "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">errorLine</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT">		</span><span class="NAME">BE.log.debug</span><span class="PUNC">(</span><span class="STRN">"Character Offset = "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">errorCharOffset</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT">		</span><span class="NAME">BE.log.debug</span><span class="PUNC">(</span><span class="STRN">"Lines = "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">lines.length</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT">		</span><span class="NAME">BE.log.debug</span><span class="PUNC">(</span><span class="STRN">"The Line Text = "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">theLine</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 92</span> 
<span class='line'> 93</span> </span><span class="WHIT">		</span><span class="COMM">//If the error line is in lines 0 to surroundingLinesPadding,</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="WHIT">		</span><span class="COMM">//set linesbefore to maximum allowed</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">errorLine</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NAME">surroundingLinesPadding</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT">			</span><span class="NAME">linesBefore</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">errorLine</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 97</span> 
<span class='line'> 98</span> </span><span class="WHIT">			</span><span class="NAME">BE.log.debug</span><span class="PUNC">(</span><span class="STRN">"Lines Before = "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">linesBefore</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>100</span> 
<span class='line'>101</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">errorLine</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">surroundingLinesPadding</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">lines.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT">			</span><span class="NAME">linesAfter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">lines.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">errorLine</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT">			</span><span class="NAME">BE.log.debug</span><span class="PUNC">(</span><span class="STRN">"Lines After Changed To: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">linesAfter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>105</span> 
<span class='line'>106</span> </span><span class="WHIT">		</span><span class="NAME">errText</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"Original Error: \n "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">err.description</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>107</span> </span><span class="WHIT">            </span><span class="STRN">"Line: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">errorLine</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"; "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"Character Offset: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>108</span> </span><span class="WHIT">			</span><span class="NAME">errorCharOffset</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>109</span> 
<span class='line'>110</span> </span><span class="WHIT">		</span><span class="COMM">//Print the before lines</span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT">		</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">linesBefore</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">errorLine</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT">			</span><span class="NAME">errText</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">lines</span><span class="PUNC">[</span><span class="NAME">l</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>114</span> 
<span class='line'>115</span> </span><span class="WHIT">		</span><span class="NAME">errText</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">errorLine</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">theLine</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT">		</span><span class="NAME">BE.log.debug</span><span class="PUNC">(</span><span class="STRN">"Lines After = "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">linesAfter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>117</span> 
<span class='line'>118</span> </span><span class="WHIT">		</span><span class="COMM">//Print the after lines</span><span class="WHIT">
<span class='line'>119</span> </span><span class="WHIT">		</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">errorLine</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">errorLine</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">linesAfter</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>120</span> </span><span class="WHIT">		</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT">			</span><span class="NAME">errText</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">lines</span><span class="PUNC">[</span><span class="NAME">l</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>122</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>123</span> 
<span class='line'>124</span> </span><span class="WHIT">		</span><span class="NAME">BE.log.debug</span><span class="PUNC">(</span><span class="STRN">"Error = "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">errText</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>125</span> 
<span class='line'>126</span> </span><span class="WHIT">		</span><span class="NAME">BE.alertError</span><span class="PUNC">(</span><span class="NAME">errText</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>127</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>128</span> </span><span class="WHIT">		</span><span class="NAME">BE.log.debug</span><span class="PUNC">(</span><span class="STRN">"Misc Resource Error occured..."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>129</span> </span><span class="WHIT">		</span><span class="COMM">//This error is not an error caused by malformed resource specs.</span><span class="WHIT">
<span class='line'>130</span> </span><span class="WHIT">		</span><span class="COMM">//Alert the error as a normal error and include the resource string.</span><span class="WHIT">
<span class='line'>131</span> </span><span class="WHIT">		</span><span class="NAME">BE.alertError</span><span class="PUNC">(</span><span class="NAME">err.description</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n Resource String: \n\n"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">res</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>132</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>133</span> </span><span class="WHIT">	</span><span class="KEYW">throw</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"Fatal UI Resource String Error. Halting execution."</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>134</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>135</span> 
<span class='line'>136</span> </span><span class="COMM">/**
<span class='line'>137</span>  * Aids in the creation of a label/input pair.
<span class='line'>138</span>  *
<span class='line'>139</span>  * @param {Object} d An object filled with properties that describe
<span class='line'>140</span>  * different aspects or values within this label/input pair.
<span class='line'>141</span>  * @param {String} d.groupName The name to give the group.
<span class='line'>142</span>  * @param {String} d.labelName The name to give the label of the input..
<span class='line'>143</span>  * @param {String} d.inputName The name to give the input field.
<span class='line'>144</span>  * @param {String} [d.groupOrientation="row"] The orientation of the group.
<span class='line'>145</span>  * Possible values are 'row' or 'col'.
<span class='line'>146</span>  * @param {String} [d.groupMargins=0] The margins to set for the group.
<span class='line'>147</span>  * @param {String} [d.groupAlignment="['fill','fill']"] The alignment to
<span class='line'>148</span>  * use for the group.
<span class='line'>149</span>  * @param {String} [d.inputText=""] The text to use as the input's value.
<span class='line'>150</span>  * @param {String} [d.inputMinSize="[]"] The minimum size for the
<span class='line'>151</span>  * input field.
<span class='line'>152</span>  * @param {String} [d.inputJustify="right"] How the label text is
<span class='line'>153</span>  * to be justified.
<span class='line'>154</span>  * @param {String} [t="EditText"] The type of input to use.
<span class='line'>155</span>  * Ex. DropDown, EditText.
<span class='line'>156</span>  * @param {String} [extraRes=""] A resource string that is inserted
<span class='line'>157</span>  * after the input field.
<span class='line'>158</span>  * @return {String|False} Returns a resource string or false if
<span class='line'>159</span>  * there was an error.
<span class='line'>160</span>  */</span><span class="WHIT">
<span class='line'>161</span> </span><span class="NAME">BE.ui.generateInputField</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">d</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">extraRes</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>162</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>163</span> 
<span class='line'>164</span> </span><span class="WHIT">	</span><span class="COMM">/*
<span class='line'>165</span> 	 * Returns a defined value
<span class='line'>166</span> 	 * Checks to see if 'a' is undefined. If so, b is returned. Otherwise,
<span class='line'>167</span> 	 * 'a' is returned.
<span class='line'>168</span> 	 * @param {Any} a Contains the value that should be checked as undefined
<span class='line'>169</span> 	 * or not.
<span class='line'>170</span> 	 * @param {Any} b The value to return if 'a' is undefined.
<span class='line'>171</span> 	 * @return {Any} Returns 'a' if 'a' is not undefined, otherwise, it
<span class='line'>172</span> 	 * returns 'b'.
<span class='line'>173</span> 	 */</span><span class="WHIT">
<span class='line'>174</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">getDefined</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>175</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>176</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>177</span> 
<span class='line'>178</span> </span><span class="WHIT">		</span><span class="NAME">e</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>179</span> </span><span class="WHIT">		</span><span class="NAME">tempD</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>180</span> </span><span class="WHIT">		</span><span class="NAME">r</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>181</span> 
<span class='line'>182</span> </span><span class="WHIT">	</span><span class="COMM">//Handle some errors</span><span class="WHIT">
<span class='line'>183</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">d</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>184</span> </span><span class="WHIT">	</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>185</span> </span><span class="WHIT">		</span><span class="NAME">BE.alertError</span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>186</span> </span><span class="WHIT">				</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="NAME">BE.ui.error.NO_DATA_FOR_INPUT_GENERATOR</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>187</span> </span><span class="WHIT">					</span><span class="NAME">$.fileName</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>188</span> </span><span class="WHIT">				</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>189</span> </span><span class="WHIT">		</span><span class="NAME">e</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>190</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">d.groupName</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT">		</span><span class="NAME">BE.alertError</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="NAME">BE.ui.error.NO_GROUP_NAME</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>192</span> </span><span class="WHIT">					</span><span class="NAME">$.fileName</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>193</span> </span><span class="WHIT">		</span><span class="NAME">e</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>194</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">d.labelName</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>195</span> </span><span class="WHIT">		</span><span class="NAME">BE.alertError</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="NAME">BE.ui.error.NO_LABEL_NAME</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>196</span> </span><span class="WHIT">					</span><span class="NAME">$.fileName</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>197</span> </span><span class="WHIT">		</span><span class="NAME">e</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>198</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">d.inputName</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>199</span> </span><span class="WHIT">		</span><span class="NAME">BE.alertError</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="NAME">BE.ui.error.NO_INPUT_NAME</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>200</span> </span><span class="WHIT">					</span><span class="NAME">$.fileName</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>201</span> </span><span class="WHIT">		</span><span class="NAME">e</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>202</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>203</span> 
<span class='line'>204</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>205</span> </span><span class="WHIT">	</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>206</span> </span><span class="WHIT">		</span><span class="COMM">//If the type of input was not specified, use EditText</span><span class="WHIT">
<span class='line'>207</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>208</span> </span><span class="WHIT">		</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>209</span> </span><span class="WHIT">			</span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"EditText"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>210</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>211</span> </span><span class="WHIT">		</span><span class="COMM">//Create a template object that should be used if a value</span><span class="WHIT">
<span class='line'>212</span> </span><span class="WHIT">		</span><span class="COMM">//is undefined</span><span class="WHIT">
<span class='line'>213</span> </span><span class="WHIT">		</span><span class="NAME">tempD</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>214</span> </span><span class="NAME">groupOrientation</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"row"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>215</span> </span><span class="WHIT">				  </span><span class="NAME">groupMargins</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>216</span> </span><span class="WHIT">				  </span><span class="NAME">groupAlignment</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"['fill','fill']"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>217</span> </span><span class="WHIT">				  </span><span class="NAME">inputText</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>218</span> </span><span class="WHIT">				  </span><span class="NAME">inputMinSize</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"[]"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>219</span> </span><span class="WHIT">				  </span><span class="NAME">inputAlignment</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"['fill', 'middle']"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>220</span> </span><span class="WHIT">				  </span><span class="NAME">inputJustify</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"right"</span><span class="WHIT">
<span class='line'>221</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>222</span> 
<span class='line'>223</span> </span><span class="WHIT">		</span><span class="NAME">d.groupOrientation</span><span class="WHIT">	</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">getDefined</span><span class="PUNC">(</span><span class="NAME">d.groupOrientation</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>224</span> </span><span class="WHIT">				</span><span class="NAME">tempD.groupOrientation</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>225</span> </span><span class="WHIT">		</span><span class="NAME">d.groupMargins</span><span class="WHIT">		</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">getDefined</span><span class="PUNC">(</span><span class="NAME">d.groupMargins</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>226</span> </span><span class="WHIT">				</span><span class="NAME">tempD.groupMargins</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>227</span> </span><span class="WHIT">		</span><span class="NAME">d.groupAlignment</span><span class="WHIT">	</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">getDefined</span><span class="PUNC">(</span><span class="NAME">d.groupAlignment</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>228</span> </span><span class="WHIT">				</span><span class="NAME">tempD.groupAlignment</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>229</span> </span><span class="WHIT">		</span><span class="NAME">d.inputText</span><span class="WHIT">			</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">getDefined</span><span class="PUNC">(</span><span class="NAME">d.inputText</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>230</span> </span><span class="WHIT">				</span><span class="NAME">tempD.inputText</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT">		</span><span class="NAME">d.inputMinSize</span><span class="WHIT">		</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">getDefined</span><span class="PUNC">(</span><span class="NAME">d.inputMinSize</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>232</span> </span><span class="WHIT">				</span><span class="NAME">tempD.inputMinSize</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>233</span> </span><span class="WHIT">		</span><span class="NAME">d.inputAlignment</span><span class="WHIT">	</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">getDefined</span><span class="PUNC">(</span><span class="NAME">d.inputAlignment</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>234</span> </span><span class="WHIT">				</span><span class="NAME">tempD.inputAlignment</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>235</span> </span><span class="WHIT">		</span><span class="NAME">d.inputJustify</span><span class="WHIT">		</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">getDefined</span><span class="PUNC">(</span><span class="NAME">d.inputJustify</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>236</span> </span><span class="WHIT">				</span><span class="NAME">tempD.inputJustify</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>237</span> 
<span class='line'>238</span> </span><span class="WHIT">		</span><span class="NAME">r</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>239</span> 
<span class='line'>240</span> </span><span class="WHIT">		</span><span class="NAME">r</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">d.groupName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">":"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="STRN">"Group {"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>241</span> </span><span class="WHIT">			</span><span class="STRN">"orientation: '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">d.groupOrientation</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"', "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>242</span> </span><span class="WHIT">			</span><span class="STRN">"margins: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">d.groupMargins</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">", "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>243</span> </span><span class="WHIT">			</span><span class="STRN">"alignment: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">d.groupAlignment</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">", "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>244</span> </span><span class="WHIT">			</span><span class="NAME">d.labelName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">": StaticText {"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>245</span> </span><span class="WHIT">			</span><span class="STRN">"text: '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">d.labelText</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"'"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>246</span> </span><span class="WHIT">			</span><span class="STRN">"},"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="COMM">//End d.labelName</span><span class="WHIT">
<span class='line'>247</span> </span><span class="WHIT">			</span><span class="NAME">d.inputName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">": "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" {"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>248</span> 
<span class='line'>249</span> </span><span class="WHIT">		</span><span class="NAME">r</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"EditText"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT">
<span class='line'>250</span> </span><span class="WHIT">			</span><span class="STRN">"text: '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">d.inputText</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"',"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>251</span> </span><span class="WHIT">			</span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>252</span> </span><span class="WHIT">		</span><span class="NAME">r</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"minimumSize: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">d.inputMinSize</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">", "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>253</span> </span><span class="WHIT">			</span><span class="STRN">"alignment: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">d.inputAlignment</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">", "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>254</span> </span><span class="WHIT">			</span><span class="STRN">"justify: '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">d.inputJustify</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>255</span> </span><span class="WHIT">			</span><span class="STRN">"'},"</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//End d.inputName</span><span class="WHIT">
<span class='line'>256</span> 
<span class='line'>257</span> </span><span class="WHIT">		</span><span class="NAME">r</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">extraRes</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">extraRes</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>258</span> </span><span class="WHIT">		</span><span class="NAME">r</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"},"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>259</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">r</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>260</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>261</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>262</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>263</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>264</span> 
<span class='line'>265</span> </span><span class="COMM">/**
<span class='line'>266</span>  * @class Takes a given window or palette object and assits in the creation of
<span class='line'>267</span>  * different views for the UI.
<span class='line'>268</span>  *
<span class='line'>269</span>  * The power comes in its ability to keep track of and give easy access to
<span class='line'>270</span>  * the hidden/shown views. Views are offered back to the user as a named
<span class='line'>271</span>  * array of references to the base Group object of each view.
<span class='line'>272</span>  * @param {Window|Palette} w The Window or Palette to base this window off of.
<span class='line'>273</span>  * @param {String} windowProps A string of different properties that should
<span class='line'>274</span>  * be set within the main group of the Window|Palette. Commas need only be
<span class='line'>275</span>  * present between defined properties, not at the end.
<span class='line'>276</span>  * 
<span class='line'>277</span>  * Example:
<span class='line'>278</span>  *
<span class='line'>279</span>  * "orientation: 'column', alignment: ['left', 'middle']"
<span class='line'>280</span>  * @returns {ViewsConstructor} The ViewsConstructor object that contains all
<span class='line'>281</span>  * of the information about created Window or Palette. The 'build' method
<span class='line'>282</span>  * returns the actual window resource that should be used.
<span class='line'>283</span>  *
<span class='line'>284</span>  */</span><span class="WHIT">
<span class='line'>285</span> </span><span class="NAME">BE.ui.viewsConstructor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">w</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">windowProps</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>286</span> 
<span class='line'>287</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">views</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>288</span> </span><span class="WHIT">		</span><span class="NAME">viewReferences</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>289</span> </span><span class="WHIT">		</span><span class="NAME">built</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>290</span> 
<span class='line'>291</span> </span><span class="WHIT">		</span><span class="COMM">/**
<span class='line'>292</span> 		 * Formats a resource string
<span class='line'>293</span>          * @memberOf BE.ui.viewsConstructor
<span class='line'>294</span> 		 * @param {String} r The resource string to format
<span class='line'>295</span> 		 * @returns {String} The formatted resource string.
<span class='line'>296</span> 		 */</span><span class="WHIT">
<span class='line'>297</span> </span><span class="WHIT">		</span><span class="NAME">formatRes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">r</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>298</span> </span><span class="WHIT">			</span><span class="COMM">//Replace { with {\n</span><span class="WHIT">
<span class='line'>299</span> </span><span class="WHIT">			</span><span class="NAME">r</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">r.replace</span><span class="PUNC">(</span><span class="REGX">/{/g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"{\n"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>300</span> </span><span class="WHIT">				</span><span class="NAME">r</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">r.replace</span><span class="PUNC">(</span><span class="REGX">/},/g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"},\n"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>301</span> </span><span class="WHIT">				</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">r</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>302</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>303</span> 
<span class='line'>304</span> </span><span class="WHIT">		</span><span class="COMM">/**
<span class='line'>305</span> 		 * Returns the final resource string of this ViewConstructor.
<span class='line'>306</span>          * @memberOf BE.ui.viewsConstructor
<span class='line'>307</span> 		 * @returns {String} The resource string of the window constructed by
<span class='line'>308</span> 		 * this ViewConstructor wrapped within group{} and with the window
<span class='line'>309</span> 		 * properties set upon creation of this ViewConstructor.
<span class='line'>310</span> 		 */</span><span class="WHIT">
<span class='line'>311</span> </span><span class="WHIT">		</span><span class="NAME">finalResource</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>312</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>313</span> </span><span class="WHIT">			</span><span class="NAME">viewResources</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>314</span> 
<span class='line'>315</span> </span><span class="WHIT">			</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">views.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>316</span> </span><span class="WHIT">				</span><span class="NAME">viewResources</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">views</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">res</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>317</span> 
<span class='line'>318</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">views.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>319</span> </span><span class="WHIT">					</span><span class="NAME">viewResources</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">",\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>320</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>321</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>322</span> 
<span class='line'>323</span> </span><span class="WHIT">			</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">"group {\n"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>324</span> </span><span class="WHIT">				</span><span class="NAME">windowProps</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">",\n"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>325</span> </span><span class="WHIT">				</span><span class="NAME">viewResources</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>326</span> </span><span class="WHIT">				</span><span class="STRN">"}"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>327</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>328</span> 
<span class='line'>329</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>330</span> </span><span class="WHIT">			</span><span class="COMM">/**
<span class='line'>331</span> 			 * Add a view to this ViewConstructor. This view will have its
<span class='line'>332</span> 			 * visibility determined by the 'showView' method and will be
<span class='line'>333</span> 			 * displayed as a stack within the main window.
<span class='line'>334</span> 			 * @param {String} n The name of the view. This name will be used
<span class='line'>335</span> 			 * when accessing this view through the array returned by the
<span class='line'>336</span> 			 * 'getViews' method.
<span class='line'>337</span> 			 * @param {String} res The resource string that defines the content
<span class='line'>338</span> 			 * of this view. This resource string will be encapsulated
<span class='line'>339</span> 			 * by Group{} and will have the name given as the 'n' argument.
<span class='line'>340</span> 			 *
<span class='line'>341</span> 			 * Note: Do not put a trailing comma after the resource string for
<span class='line'>342</span> 			 * this view. It is automatically added.
<span class='line'>343</span> 			 *
<span class='line'>344</span> 			 * @returns Nothing.
<span class='line'>345</span> 			 * @extends BE#ui#viewConstructor
<span class='line'>346</span> 			 * @see getViews
<span class='line'>347</span> 			 * @see showView
<span class='line'>348</span> 			 * 
<span class='line'>349</span> 			 */</span><span class="WHIT">
<span class='line'>350</span> </span><span class="WHIT">			</span><span class="STRN">"addView"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">n</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">res</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>351</span> </span><span class="WHIT">				</span><span class="NAME">views</span><span class="PUNC">[</span><span class="NAME">views.length</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>352</span> </span><span class="WHIT">					</span><span class="STRN">"name"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">n</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>353</span> </span><span class="WHIT">					</span><span class="STRN">"res"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">n</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">": Group {\n"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>354</span> </span><span class="WHIT">						</span><span class="NAME">formatRes</span><span class="PUNC">(</span><span class="NAME">res</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>355</span> </span><span class="WHIT">						</span><span class="STRN">"}"</span><span class="WHIT">
<span class='line'>356</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>357</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>358</span> </span><span class="WHIT">				</span><span class="COMM">/**
<span class='line'>359</span> 				 * Creates the resource string made up of all the different views
<span class='line'>360</span> 				 * added by the 'addView' method and returns the Window|Palette
<span class='line'>361</span> 				 * Object reference.
<span class='line'>362</span> 				 * @returns {Window|Palette} The final Window|Palette created by
<span class='line'>363</span> 				 * this ViewConstructor. This should be used to populate the
<span class='line'>364</span> 				 * variable you wish to use as your Window|Palette base group.
<span class='line'>365</span> 				 * @extends BE.ui.viewConstructor
<span class='line'>366</span> 				 * @see addView
<span class='line'>367</span> 				 */</span><span class="WHIT">
<span class='line'>368</span> </span><span class="WHIT">				</span><span class="STRN">"build"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>369</span> </span><span class="WHIT">					</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>370</span> </span><span class="WHIT">					</span><span class="NAME">finalRes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">finalResource</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>371</span> 
<span class='line'>372</span> </span><span class="WHIT">					</span><span class="COMM">//Add the final resource string to the grp field of the window</span><span class="WHIT">
<span class='line'>373</span> </span><span class="WHIT">					</span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>374</span> 
<span class='line'>375</span> </span><span class="WHIT">						</span><span class="NAME">w.grp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">w.add</span><span class="PUNC">(</span><span class="NAME">finalRes</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>376</span> </span><span class="WHIT">					</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>377</span> </span><span class="WHIT">						</span><span class="NAME">BE.alertError</span><span class="PUNC">(</span><span class="NAME">finalRes</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>378</span> </span><span class="WHIT">						</span><span class="NAME">BE.ui.resError</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">finalRes</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>379</span> </span><span class="WHIT">						</span><span class="COMM">//                    throw(new Error("ViewConstructor ResourceError: Unable to "+</span><span class="WHIT">
<span class='line'>380</span> </span><span class="WHIT">						</span><span class="COMM">//                        "build ViewConstructor because of error: " +</span><span class="WHIT">
<span class='line'>381</span> </span><span class="WHIT">						</span><span class="COMM">//                        e.toString()));</span><span class="WHIT">
<span class='line'>382</span> </span><span class="WHIT">					</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>383</span> 
<span class='line'>384</span> 
<span class='line'>385</span> </span><span class="WHIT">					</span><span class="COMM">//Populate view references</span><span class="WHIT">
<span class='line'>386</span> </span><span class="WHIT">					</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">views.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>387</span> </span><span class="WHIT">						</span><span class="NAME">viewReferences</span><span class="PUNC">[</span><span class="NAME">views</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">w.grp</span><span class="PUNC">[</span><span class="NAME">views</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>388</span> </span><span class="WHIT">					</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>389</span> </span><span class="WHIT">					</span><span class="NAME">built</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>390</span> </span><span class="WHIT">					</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">w</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>391</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>392</span> 
<span class='line'>393</span> </span><span class="WHIT">				</span><span class="COMM">/**
<span class='line'>394</span> 				 * Shows the given view and hides all of the others.
<span class='line'>395</span> 				 * @param {String} v The name of the view to show.
<span class='line'>396</span> 				 * @returns Nothing.
<span class='line'>397</span> 				 * @extends BE.ui.viewConstructor
<span class='line'>398</span> 				 */</span><span class="WHIT">
<span class='line'>399</span> </span><span class="WHIT">				</span><span class="STRN">"showView"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">v</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>400</span> </span><span class="WHIT">					</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">built</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>401</span> </span><span class="WHIT">					</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>402</span> </span><span class="WHIT">						</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">currView</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>403</span> 
<span class='line'>404</span> </span><span class="WHIT">						</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">views.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>405</span> </span><span class="WHIT">							</span><span class="NAME">currView</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">w.grp</span><span class="PUNC">[</span><span class="NAME">views</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>406</span> </span><span class="WHIT">							</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">views</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">v</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>407</span> </span><span class="WHIT">								</span><span class="NAME">currView.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>408</span> </span><span class="WHIT">							</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>409</span> </span><span class="WHIT">								</span><span class="NAME">currView.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>410</span> </span><span class="WHIT">							</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>411</span> </span><span class="WHIT">						</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>412</span> </span><span class="WHIT">					</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>413</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>414</span> </span><span class="WHIT">				</span><span class="COMM">/**
<span class='line'>415</span> 				 * Returns an Object of references to the base group of the given
<span class='line'>416</span> 				 * views. Useful when you want to access each view's Group Object.
<span class='line'>417</span> 				 * @returns {Object of Groups} An Object filled with references of
<span class='line'>418</span> 				 * the different view's Group Objects.
<span class='line'>419</span> 				 *
<span class='line'>420</span> 				 * Example:
<span class='line'>421</span> 				 * &lt;code>
<span class='line'>422</span> 				 * var w = new Window("palette",
<span class='line'>423</span> 				 * BE.PRad.scriptName + " " + BE.PRad.scriptVersion,
<span class='line'>424</span> 				 * undefined,
<span class='line'>425</span> 				 * {
<span class='line'>426</span> 				 *  "resizeable": false
<span class='line'>427</span> 				 *  });
<span class='line'>428</span> 				 * var viewConstructor = BE.UI_Helper.viewConstructor(w,
<span class='line'>429</span> 				 *  "orientation: 'column'"
<span class='line'>430</span> 				 * );
<span class='line'>431</span> 				 * viewConstructor.addView("viewOne",
<span class='line'>432</span> 				 * "alignment:['fill','fill']," +
<span class='line'>433</span> 				 * "orientation: 'column'," +
<span class='line'>434</span> 				 * "nameGroup: Group {" +
<span class='line'>435</span> 				 *  "orientation: 'row', " +
<span class='line'>436</span> 				 *  "margins:[10,10,10,0], " +
<span class='line'>437</span> 				 *  "nameLabel: StaticText {" +
<span class='line'>438</span> 				 *  "text: 'Your Name:'" +
<span class='line'>439</span> 				 *  "}");
<span class='line'>440</span> 				 * var v = viewConstructor.getViews();
<span class='line'>441</span> 				 * var viewOneReference = v.One;
<span class='line'>442</span> 				 * alert(viewOneReference.nameGroup.nameLabel.text); //"Your Name:"
<span class='line'>443</span> 				 * &lt;/code>
<span class='line'>444</span> 				 * @extends BE.ui.viewConstructor
<span class='line'>445</span> 				 */</span><span class="WHIT">
<span class='line'>446</span> </span><span class="WHIT">				</span><span class="STRN">"getViews"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>447</span> </span><span class="WHIT">					</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">viewReferences</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>448</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>449</span> 
<span class='line'>450</span> </span><span class="WHIT">				</span><span class="COMM">/**
<span class='line'>451</span> 				 * Returns the final resource string of the Window|Palette created
<span class='line'>452</span> 				 * by this ViewConstructor.
<span class='line'>453</span> 				 * @returns {String} The final resource string of the Window|Palette
<span class='line'>454</span> 				 * created by this ViewConstructor.
<span class='line'>455</span> 				 * @extends BE.ui.viewConstructor
<span class='line'>456</span> 				 */</span><span class="WHIT">
<span class='line'>457</span> </span><span class="WHIT">				</span><span class="STRN">"getRes"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>458</span> </span><span class="WHIT">					</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">finalResource</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>459</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>460</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>461</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>462</span> 
<span class='line'>463</span> </span><span class="WHIT">		</span><span class="NAME">BE.ui.view</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">parent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">res</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>464</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">r</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"group { "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">res</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"},"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>465</span> </span><span class="WHIT">			</span><span class="COMM">//Add the res to the parent</span><span class="WHIT">
<span class='line'>466</span> </span><span class="WHIT">			</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">parent.add</span><span class="PUNC">(</span><span class="NAME">r</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">grp</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>467</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>468</span> 
<span class='line'>469</span> </span></pre></body></html>